package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.UserMemberOrderMapper;
import com.ruoyi.order.domain.UserMemberOrder;
import com.ruoyi.order.service.IUserMemberOrderService;

/**
 * 会员订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class UserMemberOrderServiceImpl implements IUserMemberOrderService 
{
    @Autowired
    private UserMemberOrderMapper userMemberOrderMapper;

    /**
     * 查询会员订单
     * 
     * @param id 会员订单主键
     * @return 会员订单
     */
    @Override
    public UserMemberOrder selectUserMemberOrderById(Long id)
    {
        return userMemberOrderMapper.selectUserMemberOrderById(id);
    }

    /**
     * 查询会员订单列表
     * 
     * @param userMemberOrder 会员订单
     * @return 会员订单
     */
    @Override
    public List<UserMemberOrder> selectUserMemberOrderList(UserMemberOrder userMemberOrder)
    {
        return userMemberOrderMapper.selectUserMemberOrderList(userMemberOrder);
    }

    /**
     * 新增会员订单
     * 
     * @param userMemberOrder 会员订单
     * @return 结果
     */
    @Override
    public int insertUserMemberOrder(UserMemberOrder userMemberOrder)
    {
        userMemberOrder.setCreateTime(DateUtils.getNowDate());
        return userMemberOrderMapper.insertUserMemberOrder(userMemberOrder);
    }

    /**
     * 修改会员订单
     * 
     * @param userMemberOrder 会员订单
     * @return 结果
     */
    @Override
    public int updateUserMemberOrder(UserMemberOrder userMemberOrder)
    {
        userMemberOrder.setUpdateTime(DateUtils.getNowDate());
        return userMemberOrderMapper.updateUserMemberOrder(userMemberOrder);
    }

    /**
     * 批量删除会员订单
     * 
     * @param ids 需要删除的会员订单主键
     * @return 结果
     */
    @Override
    public int deleteUserMemberOrderByIds(Long[] ids)
    {
        return userMemberOrderMapper.deleteUserMemberOrderByIds(ids);
    }

    /**
     * 删除会员订单信息
     * 
     * @param id 会员订单主键
     * @return 结果
     */
    @Override
    public int deleteUserMemberOrderById(Long id)
    {
        return userMemberOrderMapper.deleteUserMemberOrderById(id);
    }
}
